{include file="index/head" /}
<div class="box">
  <form method="post" action="{:url('add')}" class="sycmsform">
    <div class="box-head">
      <h2>{$v.id?'编辑':'添加'}分类</h2>
      <div class="fr">
        <button type="submit" class="btn"><i class="icon-check"></i>{$v.id?'编辑':'添加'}</button>
        &nbsp;<a href="javascript:history.go(-1);" class="btn fr"><i class="icon-mail-reply (alias)"></i>返回</a></div>
    </div>
    <div class="form">
      <input type="hidden" name="id" value="{$v.id}" />
      <input type="hidden" name="nid" value="{$nid}" />
      <ul>
        {if condition="$v.pid neq '0'"}
        <li>
          <label>上级分类：</label>
          <div class="item">
            <div class="select"><i class="icon-caret-down"></i>
              <input type="hidden" name="pid" value="{$v.pid}" class="inputval" />
              <input type="text" readonly placeholder="请选择上级分类" value="" class="input" />
              <dl class="select-value syui-anim syui-anim-up">
                {volist name="list" id="vo"}
                {if condition="$vo.id neq $v.id"}
                <dd data="{$vo.id}" {if condition="$vo.id eq $v.pid"}class=selected{/if}>{$vo.title}</dd>
                {/if}
                {volist name="vo['son']" id="vs"}
                {if condition="$vs.id neq $v.id"}
                <dd data="{$vs.id}" {if condition="$vs.id eq $v.pid"}class=selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;|---{$vs.title}</dd>
                {/if}
                {/volist}
                {/volist}
              </dl>
            </div>
          </div>
        </li>
        {/if}
        <li>
          <label>分类名称：</label>
          <div class="item">
            <input type="text" name="title" value="{$v.title}" class="input" nullmsg="请输入分类名称"/>
          </div>
        </li>
        <li>
          <label>分类副标题：</label>
          <div class="item">
            <input type="text" name="subtitle" value="{$v.subtitle}" class="input" />
          </div>
        </li>
        <li>
          <label>网址URL名称：</label>
          <div class="item">
            <input type="text" class="input" name="entitle" value="{$v.entitle}" />
            <span class="tips">必须英文，不能带空格或 _ / 等符号</span> </div>
        </li>
        {if condition="$id eq ''"}
        <li style="overflow:hidden; margin-bottom:12px;">
          <label>批量分类名：</label>
          <div class="item">
            <textarea name="titles" class="input" style="height:120px;"></textarea>
            <div class="tips">多个分类请换行</div>
          </div>
        </li>
        {/if}
        <li>
          <label>分类图片：</label>
          <div class="item">
            <input type="text" name="img" value="{$v.img}" class="input"/>
            <button type="button" class="button fl" onclick="sycms.showupload(this)" id="image1" at="dg"><i class="icon-plus"></i>浏览上传</button>
            <div class="clear"></div>
            <div class="input-image">{if $v.img}<img src="{$v.img}" alt="" />{/if}</div>
          </div>
        </li>
        <li>
          <label>SEO标题：</label>
          <div class="item">
            <input type="text" class="input w100" value="{$v.seo_title}" name="seo_title"  />
          </div>
        </li>
        <li>
          <label>SEO关键字：</label>
          <div class="item">
            <input type="text" class="input w100" value="{$v.seo_keywords}" name="seo_keywords"  />
          </div>
        </li>
        <li style="height:70px;">
          <label>SEO描述：</label>
          <div class="item">
            <textarea type="text" class="input w100" name="seo_description">{$v.seo_description}</textarea>
          </div>
        </li>
        {if condition="$v.id neq ''"}
        <li>
          <label>是否显示：</label>
          <div class="item">
            <input type="hidden" value="{$v.isshow}" name="isshow" />
            <div class="switch {$v.isshow==1?on:''}"><em ontxt="显示" offtxt="隐藏">{$v.isshow==1?'显示':'隐藏'}</em><i></i></div>
          </div>
        </li>
        {/if}
        <li>
          <label>每页显示：</label>
          <div class="item">
            <input class="input" type="number" value="{$v.page}" name="page"  />
            <span class="tips">默认显示12条</span> </div>
        </li>
        <li>
          <label>排序：</label>
          <div class="item">
            <input class="input" type="number" value="{$v.sort|default=0}" name="sort"  />
          </div>
        </li>
        <li>
          <label>分类描述：</label>
          <div class="item">
            <textarea name="content" class="input w100 editor" style="height:120px;">{$v.content}</textarea>
          </div>
        </li>
        <li>
          <label>&nbsp;</label>
          <div class="item">
            <button type="submit" class="button"><i class="icon-check"></i>{$v.id?'编辑':'添加'}</button>
          </div>
        </li>
      </ul>
    </div>
  </form>
</div>
<script> sycms.submitform("{:url('index',['nid'=>$nid])}"); </script>